var
	glbDomainInputElement
	,glbDomainInputIsOpen
;

var startX,startY;
function onTitleDown(evt){try{
	if(evt.target==glbDomainInputElement)
		return;
		
	startX=evt.screenX-top.screenX;
	startY=evt.screenY-top.screenY;
	
	top.addEventListener("mousemove", onWindowDrag, false);
	top.addEventListener("mouseup", onWindowDragEnd, false);
	
	//evt.stop();
}catch(e){trace(e);}}

function onWindowDrag(evt){try{
	if(evt.target==glbDomainInputElement)
		return;
		
	var x=evt.screenX - startX;
	var y=evt.screenY - startY;
	top.moveTo(x,y);
	
	evt.stop();
}catch(e){trace(e);}}

function onWindowDragEnd(evt){try{
	if(evt.target==glbDomainInputElement)
		return;
	
	top.removeEventListener("mousemove", onWindowDrag, false);
	top.removeEventListener("mouseup", onWindowDragEnd, false);
	
	evt.stop();
}catch(e){trace(e);}}